#ifndef _strategy_h_
#define _strategy_h_
#include"msg.h"
#include"block.h"

class CLimitedCacheMemory
{
public:
	CLimitedCacheMemory(unsigned int max_msg_size,unsigned int max_block_size,unsigned int block_size);

	virtual struct block*	alloc_block();
	virtual void			free_block(struct block*&);
	virtual	struct msg*		alloc_msg();
	virtual void			free_msg(struct msg*&);
	virtual	void			force_free_block(struct block*);
	virtual void			force_free_msg(struct msg*);
private:		
	unsigned int			max_msg_size_;
	unsigned int			cur_msg_size_;
	unsigned int			cur_msg_count_;
    unsigned int			history_msg_count_;
	
	unsigned int			block_size_;
	unsigned int			max_block_size_;
	unsigned int			cur_block_size_;
	unsigned int			cur_block_count_;
    unsigned int			history_block_count_;
};

#endif